#include <bits/stdc++.h>
#define ll long long
#define i28 __int128
using namespace std;

int read(){
    int x=0,w=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')w=-w,ch=getchar();
    while(ch>='0'&&ch<='9')x=10*x+ch-'0',ch=getchar();
    return x*w;
}
inline void write(int x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
int n,maxn;
int r[100100],c[100100];
vector<int>x;
int nxt[100100];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    for(int i=1;i<=n;i++){
        r[i]=read(),maxn=max(maxn,r[i]);
    }
    for(int i=1;i<=n;i++)
        x.push_back(r[i]);
    sort(x.begin(),x.end());
    auto it=unique(x.begin(),x.end());
    x.erase(it,x.end());
    for(int i=1;i<=n;i++){
        c[r[i]]++;
    }
    int ans=n;
    int g=0;
    for(auto y:x){
        ans-=min(c[y],c[g]);
        c[y]=max(c[y],c[g]);
        g=y;
    }
    write(ans);
    return 0;
}
